<template>
	<view class="project-page">
		<view class="info-table">
			<wd-cell title="id" :value="Data.userInfo.id" size="large" />
		</view>
		<view class="info-table">
			<wd-cell title="头像" center size="large">
				<template #default>
					<userAvatar size="80"  :src="Data.userInfo.avatar"></userAvatar>
				</template>
			</wd-cell>
		</view>
		<view class="info-table">
			<wd-cell title="用户名" :value="Data.userInfo.username" size="large" is-link />
		</view>
		<view class="info-table">
			<wd-cell title="昵称" :value="Data.userInfo.nickname" size="large" is-link />
		</view>
		<view class="info-table">
			<wd-cell title="个人介绍" :value="Data.userInfo.introduce" size="large" is-link />
		</view>
		<view class="info-table">
			<wd-cell title="性别" :value="Data.userInfo.gender" size="large" is-link />
		</view>
		<view class="info-table">
			<wd-cell title="标题文字" value="内容" />
		</view>
		<view class="info-table">
			<wd-cell title="标题文字" value="内容" />
		</view>
	</view>

</template>

<script setup>
	import userAvatar from '@/components/user_avatar/user_avatar.vue';
	import {
		ref,
		reactive,
		getCurrentInstance,
		onMounted
	} from 'vue'
	import overallRequest from "@/utool/http/http.js"

	import {
		onReady,
		onLoad
	} from "@dcloudio/uni-app"

	const Data = reactive({
		userId:null,
		userInfo:{}
	})
	function GetInfo() {
		let user =Data.userId
		let url = `/manage/info?user=${user}`
		overallRequest(url).then(res => {
			let {data} = res 
			Data.userInfo = data
		})
	}
	onLoad((query) => {
		let {
			user
		} = query
		
		if(!user){
			uni.navigateBack()
		}else{
			Data.userId = user
			GetInfo()
		}
		
	})
</script>

<style scoped>
	page {
		box-sizing: border-box;
		height: 100%;
		background-color: #c3c3c322;
	}

	.info-table {
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		overflow: hidden;
	}
</style>